diff --git a/core/lib/Drupal/Core/ParamConverter/EntityConverter.php b/core/lib/Drupal/Core/ParamConverter/EntityConverter.php
index c3820baa..6f64e968 100644
--- a/core/lib/Drupal/Core/ParamConverter/EntityConverter.php
+++ b/core/lib/Drupal/Core/ParamConverter/EntityConverter.php
@@ -146,8 +146,11 @@ public function convert($value, $definition, $name, array $defaults) {
     //   https://www.drupal.org/node/2934192 is fixed.
     $context_id = '@user.current_user_context:current_user';
     if (isset($contexts[$context_id])) {
-      $account = $contexts[$context_id]->getContextValue();
-      unset($account->_skipProtectedUserFieldConstraint);
+      try {
+        $account = $contexts[$context_id]->getContextValue();
+        unset($account->_skipProtectedUserFieldConstraint);
+      } catch (\Drupal\Component\Plugin\Exception\ContextException $e) {
+      }
       unset($contexts[$context_id]);
     }
     $entity = $this->entityRepository->getCanonical($entity_type_id, $value, $contexts);
